<template>
  <div class="app-container">
    <el-row :gutter="15">
      <el-col style="margin-bottom: 10px">
        <el-tabs type="border-card">
          <el-tab-pane>
            <span slot="label"><i class="el-icon-info"></i> 车辆详情</span>
            <eqInfo ref="eqInfo" :eqObj="eqObj" />
          </el-tab-pane>
          <el-tab-pane>
            <span slot="label"><i class="el-icon-film"></i> 工况数据</span>
            <ecuSitong ref="ecuSitong" :eqObj="eqObj" v-if="eqObj.interface_type === 'STPT'" />
            <ecuHuida ref="ecuHuida" :eqObj="eqObj" v-if="eqObj.interface_type === 'HDPT' ||  eqObj.interface_type === 'HDZD' ||  eqObj.interface_type === 'LSPT'" />
          </el-tab-pane>
          <el-tab-pane>
            <span slot="label"><i class="el-icon-location-information"></i> 轨迹回放</span>
            <gps ref = "gps" :eqObj="eqObj"/>
          </el-tab-pane>
          <el-tab-pane>
            <span slot="label"><i class="el-icon-edit"></i> 作业记录</span>
            <workAreaHuida ref = "workAreaHuida" v-if="eqObj.interface_type === 'HDPT'"  :eqObj="eqObj"/>
            <workAreaLianshi ref = "workAreaLianshi" v-if="eqObj.interface_type === 'LSPT'"  :eqObj="eqObj"/>
          </el-tab-pane>
        </el-tabs>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import crud from '@/mixins/crud'
import eqInfo from './eqInfo'
import ecuSitong from './ecuSiTong'
import ecuHuida from './ecuHuida'
import gps from './gps'
import workAreaHuida from './workAreaHuida'
import workAreaLianshi from './workAreaLianshi'

import { getEqInfo } from '@/api/jf/equipmentDetialInfo'

export default {
  name: 'equipmentDetail',
  components: {eqInfo,ecuSitong,ecuHuida,gps,workAreaHuida,workAreaLianshi},
  mixins: [crud],
  data() {
    return {
      eqCode:"",
      eqObj:{}
    }
  },
  created() {
    this.eqCode = this.$route.params.eqCode
      // 获取设备详细信息
      getEqInfo({eq_code:this.eqCode}).then(data => {
        this.eqObj = data.data
        console.log("this.eqObj",this.eqObj )
        console.log("eqObj.interface_type == 'HDPT'",this.eqObj.interface_type == 'HDPT')
      })
  },
  methods: {

  }
}
</script>

<style rel="stylesheet/scss" lang="scss">
.edit-input {
  .el-input__inner {
    border: 1px solid #e5e6e7;
  }
}
</style>

<style scoped>
::v-deep .input-with-select .el-input-group__prepend {
  background-color: #fff;
}
</style>
